<tagLib name="html" />

<include file="Public:header" />

<div class="container" id="cpcontainer">
    <h3>{$Think.lang.captcha.title}</h3>
    <p class="tips">{$Think.lang.captcha.tips}</p>
    <form name="cpform" method="post" action="__URL__/captcha">
    <input type="hidden" name="op" value="save" />
    <table class="tb tb2">
        <tbody id="parameters">
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.char_length}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="captcha_parameters[char_length]" value="{$rs.captcha_parameters.char_length}" type="text" class="txt"  /></td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.char_type}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_parameters[char_type]" radios="charTypeRadios" checked="charTypeChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.image_type}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_parameters[image_type]" radios="imageTypeRadios" checked="imageTypeChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.image_width}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="captcha_parameters[image_width]" value="{$rs.captcha_parameters.image_width}" type="text" class="txt"  /></td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.image_height}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="captcha_parameters[image_height]" value="{$rs.captcha_parameters.image_height}" type="text" class="txt"  /></td>
            <td class="vtop tips2"></td>
        </tr>
        </tbody>

        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.when_register}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_when[register]" radios="registerCaptchaRadios" checked="registerCaptchaChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.when_login}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_when[login]" radios="loginCaptchaRadios" checked="loginCaptchaChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.when_post}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_when[post]" radios="postCaptchaRadios" checked="postCaptchaChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.when_report}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_when[report]" radios="reportCaptchaRadios" checked="reportCaptchaChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.when_email}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="captcha_when[email]" radios="emailCaptchaRadios" checked="emailCaptchaChecked" separator=" " />
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.captcha.group_without_captcha} <input class="checkbox" name="chkall" onclick="checkAll('prefix', this.form, 'group_without_captcha', 'chkall', true)" type="checkbox" id="chkallgroups" /><label for="chkallgroups"> {$Think.lang.check_all}</td></tr>
        <tr>
            <td class="vtop rowform">
                <ul onmouseover="altStyle(this);">
                    <volist name="userGroupList" id="vo">
                    <li style="width:150px;padding:3px 0px;"><input class="checkbox" type="checkbox" name="group_without_captcha[]" value="{$vo.group_id}" <in name="vo.group_id" value="$rs.group_without_captcha">checked="checked"</in> />{$vo.name}&nbsp;<span class="count">({$vo.group_id|get_group_user_count})</span></li>
                    </volist>
                </ul>
            </td>
            <td class="vtop tips2">{$Think.lang.captcha.group_without_captcha_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="15"><div class="fixsel"><input class="btn" type="submit" value="{$Think.lang.submit}" /></div></td></tr>
    </table>
    </form>
</div>

<script type="text/javascript">
$(function(){
    var type = '{$rs.captcha_type}';
    if(type == 'recaptcha'){
        $('#recaptcha').show();
    }
});

function switchCaptchaType(obj){
    $('#parameters,#recaptcha').hide();
    if($(obj).val()=='recaptcha'){
        $('#recaptcha').show();
    }else{
        $('#parameters').show();
    }
}
</script>

<include file="Public:footer" />
